package ug.co.icom.kyazze.healthticket.data;


import ug.co.icom.kyazze.healthticket.R;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class CustomListAllergyNames extends ArrayAdapter<String>{

	private final Activity context;
	private final String[] web;
	//private final Integer[] imageId;
	public CustomListAllergyNames(Activity context,
			String[] web) {
		super(context, R.layout.list_single, web);
		this.context = context;
		this.web = web;
		//this.imageId = imageId;

	}
	@Override
	public View getView(int position, View view, ViewGroup parent) {
		@SuppressWarnings("unused")
		View retval = null;
		LayoutInflater inflater = context.getLayoutInflater();
		View rowView= inflater.inflate(R.layout.list_single, null, true);
		TextView txtTitle = (TextView) rowView.findViewById(R.id.txt);
		TextView number = (TextView) rowView.findViewById(R.id.img);

		//ImageView imageView = (ImageView) rowView.findViewById(R.id.img);
		txtTitle.setText(web[position]);
		int start_val = position+1;
		number.setText(""+start_val);

		//imageView.setImageResource(imageId[position]);
		return rowView;
	}
}